//
//  RemindListViewController.m
//  EPBPro
//
//  Created by wucha on 2018/7/3.
//  Copyright © 2018年 fc. All rights reserved.
//

#import "RemindListViewController.h"
#import "HttpContractAction.h"
#import "ShopTypeTableViewCell.h"

@interface RemindListViewController ()
@property (nonatomic,strong) NSArray *listArray;

@end

@implementation RemindListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.titleName = @"提醒";
    self.tableView.separatorStyle = 0;
    [self loadData];
}

-(void)loadData{
    [self showWaitingViewWithMessage:@"加载中..." style:WaitingViewShowStyleFullSelfView];
    [HttpContractAction getRemindList:^(id result, NSError *error) {
        [self dismissWaitingView];
        if (!error) {
            self.listArray = result;
            [self.tableView reloadData];
        }
    }];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return self.listArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    ShopTypeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[ShopTypeTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    // Configure the cell...
    MerchantContractInfo *merchantContractInfo = self.listArray[indexPath.row];
    cell.arrowImageView.hidden = YES;
    [cell setShopTypeCell:merchantContractInfo];
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//    MerchantContractInfo *merchantContractInfo = self.listArray[indexPath.row];
//    ShopTypeDetailViewController *shopTypeDetailViewController = [[ShopTypeDetailViewController alloc] initWithShopTypeInfo:merchantContractInfo];
//    [self.navigationController pushViewController:shopTypeDetailViewController animated:YES];
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 115;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
